WIDTH Statements Action Assign an output-line width to a device (such as a printer) or to a file, or change the number of columns and lines displayed on the screen. Syntax WIDTH screenwidth% , screenheight% WIDTH { #filenumber% | device$}, width% WIDTH LPRINT width% Remarks The different forms of the WIDTH statements are explained in the following list. WIDTH screenwidth% , screenheight% Sets number of columns and lines to display on the screen. The value of screenwidth% must be either 40 or 80; default is 80. The table below has details about the value of screenheight%. WIDTH # filenumber%, width% Sets to width% the output-line width of an output device already opened as a file (for example, LPT1 or CONS). The argument filenumber% is the number used to open the file with the OPEN statement. The number sign (#) in front of filenumber% is not optional.This form permits altering the width while a file is open, because the statement takes effect immediately. WIDTH device$, width% Sets to width% the line width of device (a device filename). The device should be a string expression (for example, "LPT1."). Note that he width% assignment is deferred until the next OPEN statement affecting the device. The assignment does not affect output for an already open file. WIDTH LPRINT width% Sets to width% the line width of the line printer, for use by subsequent LPRINT statements. Equivalent to the statement form.WIDTH "LPT1.", width%Not all of the argument values are valid in every case; it depends on the installed display adapter and the screen mode established by the most recently executed SCREEN statement. The value of screenheight% may be 25, 30, 43, 50, or 60, depending on the display adapter used and the screen mode. Table 1.21 lists the number of lines that can be displayed when a program is started. See Also SCREEN Statement, VIEW PRINT Example The following example demonstrates the effect of the WIDTH statement on output. CLS ' Open the port at the proper baud rate. OPEN "COM1.9600,N,8,1,ASC,LF" FOR OUTPUT AS #1 Test$ = "1234567890"' Set up a test string. WIDTH #1, 3' Change width to 3. PRINT #1, Test$ Output 123 456 789 0